#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<map>
#include<stack>
#include<vector>
#include<queue>
#include<set>
#include<algorithm>
#include<iomanip>

#define max(a, b)   (a>b?a:b)
#define min(a, b)   (a<b?a:b)
#define swap(a, b)  (a=a+b,b=a-b,a=a-b)
#define e  2.718281828459045
#define INF 0x3f3f3f3f
#define PI acos(-1)
#define eps 1.0e18
#define lowbit(x) (x&(-x))
#define read(x) scanf("%d",&x)
#define put(x) printf("%d\n",x)
#define memset(x, y) memset(x,y,sizeof(x))
#define Debug(x) cout<<x<<" "<<endl
#define lson i << 1,l,m
#define rson i << 1 | 1,m + 1,r
#define rep(x, y, z) for(int x = y; x <= z; x++)
#define per(x, y, z) for(int x = y; x >= z; x--)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

ll qpow(ll a, ll b, ll mod) {
    ll res = 1;
    while (b) {
        if (b & 1) { res = res * a % mod; }
        b >>= 1;
        a = a * a % mod;
    }
    return res % mod;
}

const ll mod = 1e9 + 7;
const int maxn = 2e5 + 5;
int a[5];

int main() {
    ios::sync_with_stdio(false);
    for (int i = 0; i < 5; i++) {
        cin >> a[i];
    }
    sort(a, a + 5);
    ll ans = 1e18;
    while (next_permutation(a, a + 5)) {
        ll cnt1 = a[0] * 10 + a[1];
        ll cnt2 = a[2] * 100 + a[3] * 10 + a[4];
        if (cnt1 < 10 || cnt2 < 100)continue;
        ans = min(cnt1 * cnt2, ans);
    }
    cout << ans << endl;

    return 0;
}
